PopupMenu Class
A control that presents a list of items. The user can select one item.
More information available in parent classes: RectControl:Control:Object
The ComboBox control is similar except that the user also has the option of typing an item instead of choosing one from the list of items.
Because this is a RectControl, see the RectControl for other properties and events that are common to all RectControl objects.
Examples
This code in the Open event handler populates a popup menu and sets the initial value to the current month:
Dim i,last as Integer
Dim d as New Date
s="January,February,March,April,May,June,July," _
+"August,September,October,November,December"
last= CountFields(s,",")
For i=1 to last
me.addRow NthField(s,",",i)
Next
me.ListIndex=d.Month-1
Examine the value of ListIndex in the Change event handler to determine which item was selected.
This example adds an item to PopupMenu
1.
This example populates the RowTag identifier with a sequence number
:
Since RowTag is a Variant, you must first convert it to an Integer if you want to compare it to another integer. Do this with a simple assignment statement such as:
Then compare RecID to another Integer.
This example opens a new window when an item is chosen.
Dim w As ListEditorWindow
If PopupMenu1.text="Edit List..." Then
w= New ListEditorWindow
End If
Changing the selected item in a Popup
Menu:
Displaying the RowTag of the selected menu item:
See Also
BevelButton, ContextualMenu, ComboBox, EditField controls; RectControl class.